#ifndef DATABASEINTERFACE_H
#define DATABASEINTERFACE_H

#include <QObject>
#include <QtSql>
#include <QtDebug>
#include <QUuid>
#include <QDateTime>

class DatabaseInterface : public QObject
{
    Q_OBJECT
public:
    explicit DatabaseInterface(QObject *parent = 0);
        ~DatabaseInterface();

signals:
    void logInVerified(bool, int);
    void sendLog(const QString &, const QString &, const QString &);
    void queryDone();
    void newLogSuccess(const QString &);
    void newLogFailed();
    void accessListSuccess(QStringList *);
    void accessListFailed(const QString &);
    void newUserSuccess(const QString &);
    void newUserFailed(const QString &);
    void removeUserSuccess();
    void removeUserFailed(const QString &);
    void addNewAccessSuccess();
    void addNewAccessFailed(const QString &);
    void removeAccessRightSuccess();
    void removeAccessRightFailed(const QString &);


public slots:
    //client
    void attemptLogIn(const QString &, const QString &);
    void retrieveLogs(QStringList *);
    void addNewLog(const QString &, const QString &);

    //client/management
    void getAccessList(const QString &); // if manager, return allllll users in the system
    //management
    void addNewUser(const QString &, const QString &, int); // *
    void removeUser(const QString &);
    void addNewAccessRight(const QString &, const QString &);
    void removeAccessRight(const QString &, const QString &);




private:

    QSqlDatabase db;
};

#endif // DATABASEINTERFACE_H
